function toPoint() {
    window.history.back(-1);
}

function pointBatchAdd(){
    var pointFile = document.getElementById("pointFile").files[0];
    console.log("pointFile:",pointFile);
    var formData = new FormData()
    formData.append('pointFile', pointFile)
    $.ajax({
        type: "POST",
        async: false,
        url: "/multipower/point/batchAdd",
        data: formData,
        // 告诉jQuery不要去处理发送的数据
        processData: false,
        // 告诉jQuery不要去设置Content-Type请求头
        contentType: false,
        success: function (data) {
            // console.log("data:",data);
            //成功后把文件上传组件的值置空，不然无法二次上传修改后的同名excel文件
            document.getElementById('pointFile').value = null;
            if(data.status==1){
                window.location.href = "/multipower/point.html";
                window.parent.layerAlert("批量添加成功", {
                    icon: 6,
                    title: "提示"
                });
            }else{
                window.parent.layerAlert(data.msg, {
                    icon: 6,
                    title: "提示"
                });
            }
        },
        error:function () {
            window.parent.layerAlert("批量添加失败", {
                icon: 5,
                title: "提示"
            });
        }
    })
}

function download() {
    window.location.href = "file/download/data.zip"
}

var vm = new Vue({
    el:'#app',
    methods:{
        download:function (){
            window.location.href = "file/download/pointTemplate.xlsx"
        }
    }
})